<?php
include 'config.php';
class Connection extends Config {
    private $link;
    function Connection() {
        
    }
    public function connect() {
        $this->link = mysql_connect(parent::getServer(), parent::getUser(), parent::getPass());
        if (!$this->link) {
            die('No pudo conectarse: ' . mysql_error());
        }
        if (!mysql_select_db(parent::getDataBase(), $this->link)) {
            die('No pudo seleccionar la base de datos: ' . mysql_error());
        }
    }
    public function close() {
        mysql_close($this->link);
    }
    public function executeQuery($commandQuery) {
        $result = mysql_query($commandQuery);
        return $result;
    }
    public function executeComand($commandQuery) {
        mysql_query($commandQuery);
    }

}

?>